package hao.bk.sql.bo;

import java.text.Collator;
import java.util.Locale;

public class Location implements Comparable<Location> {
	
	private int id;
	private String name;
	private int type;
	private String phone;
	private String logo;
	private Typeshop typeshop;
	private boolean favorite;
	private String address;
	public String comparedStr;
	
	public Location() {
		id = 0;
		name="";
		type = 1;
		phone = "";
		logo = "";
		typeshop = new Typeshop();
		typeshop.setId(1);
		favorite = false;
		address = "";
	}
	/** các phương thức set và get */
	
	public int getId() {
		return this.id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getType() {
		return this.type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public String getPhone() {
		return this.phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getLogo() {
		return this.logo;
	}
	public void setLogo(String logo) {
		this.logo = logo;
	}
	public boolean isFavorite() {
		return this.favorite;
	}
	public void setFavorite(boolean favorite) {
		this.favorite = favorite;
	}
	public String getAddress() {
		return this.address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public Typeshop getTypeshop() {
		return typeshop;
	}
	public void setTypeshop(Typeshop typeshop) {
		this.typeshop = typeshop;
	}

	public String toString() {

		String result = "id = " + id + ", name = " + name + ", type = " + type + ", phone = " + phone
				 + ", logo = " + logo + ", favorite = " + favorite + ", address = " + address;
		return result;

	}

	@Override
	public int compareTo(Location another) {
		Locale locale = Locale.getDefault();
		Collator collator = Collator.getInstance(locale);
		return collator.compare(name, another.getName());
	}

}
